.ai-analysis-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  backdrop-filter: blur(4px);
}

.ai-analysis-modal {
  background: white;
  border-radius: 16px;
  max-width: 600px;
  width: 95%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
  border-radius: 16px 16px 0 0;
}

.analysis-header h3 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.refresh-btn {
  background: #17a2b8;
  color: white;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
}

.refresh-btn:hover:not(:disabled) {
  background: #138496;
  transform: rotate(180deg);
}

.refresh-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: #e9ecef;
  color: #333;
}

.analysis-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.original-text {
  padding: 20px 24px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.text-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 500;
}

.text-content {
  font-size: 16px;
  color: #333;
  line-height: 1.5;
  font-weight: 500;
}

.analysis-tabs {
  display: flex;
  border-bottom: 1px solid #e9ecef;
  background: white;
  overflow-x: auto;
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  min-width: 80px;
  padding: 12px 8px;
  border: none;
  background: none;
  color: #666;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}

.tab-btn:hover {
  background: #f8f9fa;
  color: #333;
}

.tab-btn.active {
  color: #007bff;
  border-bottom-color: #007bff;
  background: white;
}

.tab-content {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
}

.translation-content,
.grammar-content {
  line-height: 1.6;
}

.translation-text,
.grammar-text {
  font-size: 15px;
  color: #333;
  background: #f8f9fa;
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid #007bff;
}

.vocabulary-list,
.points-list,
.examples-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vocabulary-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  border-left: 4px solid #28a745;
}

.word-header {
  margin-bottom: 8px;
}

.word {
  font-size: 16px;
  font-weight: bold;
  color: #28a745;
  cursor: pointer;
  transition: all 0.2s ease;
}

.word:hover {
  color: #1e7e34;
  text-decoration: underline;
}

.word-explanation {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

.point-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: #fff3cd;
  padding: 12px;
  border-radius: 6px;
  border-left: 4px solid #ffc107;
}

.point-bullet {
  color: #ffc107;
  font-weight: bold;
  font-size: 16px;
  line-height: 1;
  margin-top: 2px;
}

.point-text {
  flex: 1;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}

.example-item {
  background: #e7f3ff;
  border-radius: 8px;
  padding: 16px;
  border-left: 4px solid #007bff;
}

.example-en {
  font-size: 14px;
  color: #333;
  margin-bottom: 6px;
  font-style: italic;
}

.example-zh {
  font-size: 13px;
  color: #666;
}

.no-content {
  text-align: center;
  color: #999;
  font-style: italic;
  padding: 40px;
}

.analysis-footer {
  padding: 12px 24px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  text-align: center;
  flex-shrink: 0;
}

.analysis-footer p {
  margin: 0;
  font-size: 12px;
  color: #666;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .ai-analysis-modal {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }

  .analysis-header {
    padding: 16px 20px;
    border-radius: 0;
  }

  .analysis-header h3 {
    font-size: 16px;
  }

  .refresh-btn {
    font-size: 14px;
    min-width: 28px;
    min-height: 28px;
    padding: 5px 6px;
  }

  .original-text {
    padding: 16px 20px;
  }

  .text-content {
    font-size: 15px;
  }

  .tab-btn {
    padding: 10px 6px;
    font-size: 12px;
    min-width: 70px;
  }

  .tab-content {
    padding: 16px 20px;
  }

  .translation-text,
  .grammar-text {
    font-size: 14px;
    padding: 12px;
  }

  .vocabulary-item,
  .example-item {
    padding: 12px;
  }

  .word {
    font-size: 15px;
  }

  .point-item {
    padding: 10px;
  }

  .analysis-footer {
    padding: 10px 20px;
  }
}

@media (max-width: 480px) {
  .tab-btn {
    padding: 8px 4px;
    font-size: 11px;
    min-width: 60px;
  }

  .tab-content {
    padding: 12px 16px;
  }

  .translation-text,
  .grammar-text {
    font-size: 13px;
    padding: 10px;
  }

  .vocabulary-item,
  .example-item,
  .point-item {
    padding: 10px;
  }

  .word {
    font-size: 14px;
  }

  .word-explanation,
  .point-text,
  .example-en {
    font-size: 13px;
  }

  .example-zh {
    font-size: 12px;
  }

  .refresh-btn {
    font-size: 13px;
    min-width: 26px;
    min-height: 26px;
    padding: 4px 5px;
  }
}

/* 滚动条样式 */
.analysis-content::-webkit-scrollbar,
.tab-content::-webkit-scrollbar {
  width: 6px;
}

.analysis-content::-webkit-scrollbar-track,
.tab-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.analysis-content::-webkit-scrollbar-thumb,
.tab-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.analysis-content::-webkit-scrollbar-thumb:hover,
.tab-content::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}